<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
   	xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
   	xmlns:f="http://xmlns.jcp.org/jsf/core"
   	xmlns:h="http://xmlns.jcp.org/jsf/html"
   	xmlns:p="http://primefaces.org/ui"   
   	xmlns:c="http://xmlns.jcp.org/jsp/jstl/core">	
   	
	
		<div class="sub_grade ">
			
			<h:panelGrid
				columns="2"
				columnClasses="label, value"
				cellpadding="5"
				cellspacing="0"
				style="width: 100%"
				rendered="#{param.showSupplier}"
			>
			
				<p:outputLabel
					value="中选中介" 	rendered="#{not empty bulletinHome3.instance.successTrade}"
					style="color: red; font-size: 1.2em; font-weight: bold;"
				/>
				<h:outputText 		rendered="#{not empty bulletinHome3.instance.successTrade}"
					value="#{bulletinHome3.instance.successTrade.supplier.cnname}"
					style="color: red; font-size: 1.2em; font-weight: bold;"
				/>
				
				<p:outputLabel
					value="流拍原因" 	rendered="#{not empty bulletinHome3.instance.reChooseReason &amp;&amp; bulletinHome3.instance.tradeStatus eq 'Passed'}"
					style="color: red; font-size: 1.2em; font-weight: bold;"
				/>
				<h:outputText 		rendered="#{not empty bulletinHome3.instance.reChooseReason &amp;&amp; bulletinHome3.instance.tradeStatus eq 'Passed'}"
					value="#{bulletinHome3.instance.reChooseReason}"
					style="color: red; font-size: 1.2em; font-weight: bold;"
				/>
								
				<p:outputLabel
					value="成交价(元)" rendered="#{(bulletinHome3.instance.wayOfChoose eq 'Average' or bulletinHome3.instance.wayOfChoose eq 'Price') &amp;&amp; bulletinHome3.instance.tradeStatus eq 'Agreed'}"
					style="color: red; font-size: 1.2em; font-weight: bold;"
				/>
				<h:outputText rendered="#{(bulletinHome3.instance.wayOfChoose eq 'Average' or bulletinHome3.instance.wayOfChoose eq 'Price') &amp;&amp; bulletinHome3.instance.tradeStatus eq 'Agreed'}"
					value="#{bulletinHome3.instance.agreedPrice}"
					style="color: red; font-size: 1.2em; font-weight: bold;"
				/>

				<p:outputLabel
						value="均价(元)" rendered="#{(bulletinHome3.instance.wayOfChoose eq 'Average' ) &amp;&amp; bulletinHome3.instance.tradeStatus eq 'Agreed'}"
						style="color: red; font-size: 1.2em; font-weight: bold;"
				/>
				<h:outputText rendered="#{(bulletinHome3.instance.wayOfChoose eq 'Average') &amp;&amp; bulletinHome3.instance.tradeStatus eq 'Agreed'}"
							  value="#{bulletinHome3.instance.average}"
							  style="color: red; font-size: 1.2em; font-weight: bold;"
				/>

				<p:outputLabel
					value="备选中介" rendered="#{not empty bulletinHome3.instance.backupTrades}"
					style="color: red; font-size: 1.2em; font-weight: bold;"
				/>
				<h:outputText rendered="#{not empty bulletinHome3.instance.backupTrades}"
					value="#{bulletinHome3.instance.getBackUpSupplierNames()}"
					style="color: red; font-size: 1.2em; font-weight: bold;"
				/>
			
			</h:panelGrid>
						
			<h:panelGrid
				columns="2"
				columnClasses="label, value"
				cellpadding="5"
				cellspacing="0"
				style="width: 100%"
			>	
				<p:outputLabel
					for="bulletinProjectName"
					value="采购项目名称"
				/>
				<h:outputText
					id="bulletinProjectName"
					value="#{bulletinHome3.instance.projectName}"
				/>

				<p:outputLabel
					for="bulletinAmountOfInvestment"
					value="项目总投资（元）"
				/>
				<h:outputText id="bulletinAmountOfInvestment" minValue="0" value="#{bulletinHome3.instance.amountOfInvestment}"  >
					<f:convertNumber minFractionDigits="2" maxFractionDigits="2"/>
				</h:outputText>

				<p:outputLabel
					for="bulletinPrice"
					value="服务金额（元）"
				/>
				<h:outputText id="bulletinPrice" value="#{bulletinHome3.instance.price}" minValue="0" >
      				<f:convertNumber minFractionDigits="2" maxFractionDigits="2"/>
      			</h:outputText>

				<p:outputLabel
					for="bulletinPriceRemark"
					value="服务金额说明"
				/>
				<h:outputText
					id="bulletinPriceRemark"
					value="#{bulletinHome3.instance.priceRemark}"
				/>

				<p:outputLabel
					for="bulletinContent"
					value="服务内容"
				/>
				<h:outputText
					id="bulletinContent"
					value="#{bulletinHome3.instance.content}"
				/>

				<p:outputLabel
					for="bulletinProjectInfo"
					value="项目建设内容"
				/>
				<h:outputText
					id="bulletinProjectInfo"
					value="#{bulletinHome3.instance.projectInfo}"
				/>
				
				<p:outputLabel value="服务事项要求" rendered="#{bulletinHome3.instance.qualificationGroup.getAgentServiceGroups().size() > 0}" />
				<p:outputPanel rendered="#{bulletinHome3.instance.qualificationGroup.getAgentServiceGroups().size() > 0}" styleClass="certs">
					<p:repeat var="_serviceGroup" value="#{bulletinHome3.instance.qualificationGroup.getAgentServiceGroups()}" varStatus="_groupStatus">
							<p:panelGrid cellpadding="5"  style=" margin-bottom: 10px;width:100%">
								<p:row style="width:100%">	
									<p:column>
										<h2 >
											服务事项要求组#{_groupStatus.index + 1}（#{_serviceGroup.relation.typeName}组）
										</h2>
									</p:column>
								</p:row>
								
									<p:row>
								<p:column>
									<p:panelGrid cellpadding="5"  style="width:100%">
										<p:row styleClass="rowStyle">
											<p:column>
												服务事项名称
											</p:column>
											<p:column>
												对应资质大类
											</p:column>
										</p:row>
										
										<p:repeat var="_service" value="#{_serviceGroup.agentServices}">
											<p:row>
												<p:column>
													<h:outputText value="#{_service.name}" />
												</p:column>
												<p:column>
													<h:outputText value="#{_service.qualificationClass.name}" />
												</p:column>
											</p:row>
										</p:repeat>
									</p:panelGrid>
								</p:column>
							</p:row>
						</p:panelGrid>		
					</p:repeat>
				</p:outputPanel>
				
				<p:outputLabel value="资质要求" rendered="#{bulletinHome3.instance.qualificationGroup.getQualificationGroups().size () > 0}" />
				<p:outputPanel rendered="#{bulletinHome3.instance.qualificationGroup.getQualificationGroups().size () > 0}">
					<h:outputText value="#{bulletinHome3.instance.qualificationGroup.getQualificationGroupDetail()}" />
					<ui:remove>
						<h:outputText value="#{bulletinHome3.instance.qualificationTemplate.detail}" />；
					</ui:remove>
				</p:outputPanel>
				<p:outputLabel value="中介报名上传附件要求" rendered="#{bulletinHome3.instance.defs.size () > 0}" />
				<p:outputPanel rendered="#{bulletinHome3.instance.defs.size () > 0}">
					<ui:include src="/WEB-INF/templates/public/bulletinApplyReqInfo.xhtml" />
				</p:outputPanel>
				<p:outputLabel
					for="bulletinReqRemark"
					value="公告要求说明"
				/>
				<h:outputText
					id="bulletinReqRemark"
					value="#{bulletinHome3.instance.reqRemark}"
				/>

				<p:outputLabel
					for="bulletinLimitOfTime"
					value="合同约定完成时限"
				/>
				<p:outputPanel id="bulletinLimitOfTime">
					<h:outputText value="#{bulletinHome3.instance.limitOfTime}" />
					<h:outputText value="#{bulletinHome3.instance.limitUnit.typeName}" />
				</p:outputPanel>

				<p:outputLabel
					for="bulletinLimitRemark"
					value="合同约定完成时限说明"
				/>
				<h:outputText
					id="bulletinLimitRemark"
					value="#{bulletinHome3.instance.limitRemark}"
				/>

				<p:outputLabel
					for="bulletinWayOfPayment"
					value="付款方式"
				/>
				<h:outputText
					id="bulletinWayOfPayment"
					value="#{bulletinHome3.instance.wayOfPayment}"
				/>

				<p:outputLabel
					for="bulletieWayOfChoose"
					value="选取方式"
				/>
				<h:outputText
					id="bulletieWayOfChoose"
					value="#{bulletinHome3.instance.wayOfChoose.typeName}"
				/>
				
				<p:outputLabel value="预期中介报名数量" id="candidateTradeCountLabel" rendered="#{bulletinHome3.instance.wayOfChoose.name() == 'Best' }" />	
				
				<h:outputText
					rendered="#{bulletinHome3.instance.wayOfChoose.name() == 'Best'}"
					value="#{bulletinHome3.instance.candidateTradeCount}"
				/>
				
				<p:outputLabel
					value="最高限价（元）"
					rendered="#{bulletinHome3.instance.wayOfChoose.name() == 'Price' or bulletinHome3.instance.wayOfChoose.name() == 'Average'}"
				/>
				<h:outputText
					id="industryStandard"
					rendered="#{bulletinHome3.instance.wayOfChoose.name() == 'Price' or bulletinHome3.instance.wayOfChoose.name() == 'Average'}"
					value="#{bulletinHome3.instance.industryStandard}"
				/>
				
				<p:outputLabel
					for="bulletinEndingApplyTime"
					value="截止报名时间"
				/>
				<h:outputText
					id="bulletinEndingApplyTime"
					value="#{bulletinHome3.instance.endingApplyTime}"
				>
					<f:convertDateTime pattern="yyyy-MM-dd HH:mm" />
				</h:outputText>

				<p:outputLabel
					for="bulletinAddressOfChoose"
					value="公开选取中介地址"
				/>
				<h:outputText
					id="bulletinAddressOfChoose"
					value="#{bulletinHome3.instance.addressOfChoose}"
					styleClass="input-large"
				/>

				<p:outputLabel
					for="bulletinChooseTime"
					value="开始选取时间"
				/>
				<h:outputText
					id="bulletinChooseTime"
					value="#{bulletinHome3.instance.chooseTime}"
				>
					<f:convertDateTime pattern="yyyy-MM-dd HH:mm" />
				</h:outputText>

				<p:outputLabel
					for="bulletinOverTime"
					value="成交日期"
				/>
				<h:outputText
					id="bulletinOverTime"
					value="#{bulletinHome3.instance.overTime}"
				>
					<f:convertDateTime pattern="yyyy-MM-dd HH:mm" />
				</h:outputText>

				<p:outputLabel
					for="bulletinTeleOfConsult"
					value="咨询电话"
				/>
				<h:outputText
					id="bulletinTeleOfConsult"
					value="#{bulletinHome3.instance.teleOfConsult}"
				/>

				<p:outputLabel
					for="bulletinTeleOfSupervise"
					value="监督电话"
				/>
				<h:outputText
					id="bulletinTeleOfSupervise"
					value="#{bulletinHome3.instance.teleOfSupervise}"
				/>
				
				<p:outputLabel value="报价记录" rendered="#{bulletinHome3.instance.wayOfChoose eq 'Average' &amp;&amp; bulletinHome3.instance.tradeStatus eq 'Agreed'}" />
				<p:outputPanel rendered="#{bulletinHome3.instance.wayOfChoose eq 'Average' &amp;&amp; bulletinHome3.instance.tradeStatus eq 'Agreed'}" >
					<p:panelGrid cellpadding="5"  style=" margin-bottom: 10px;width:100%">
						<p:row style="width:100%" styleClass="rowStyle">	
							<p:column>
								中介名称
							</p:column>
							<p:column>
								最终报价(元)
							</p:column>
						</p:row>
						<p:repeat var="_trade" value="#{bulletinHome3.instance.verifiedTrades}" varStatus="_status">										
							<p:row style="width:100%">	
								<p:column>
									#{_trade.supplier.cnname}
								</p:column>
								<p:column>
									#{_trade.offer == null ? '未报价' : _trade.offer }
								</p:column>
							</p:row>
						</p:repeat>
					</p:panelGrid>
				</p:outputPanel>		
				
				<p:outputLabel value="作废记录" rendered="#{param.hasZF}" />
				<p:outputPanel rendered="#{param.hasZF}" >
					<c:set var="discardRecords" value="#{bulletinDiscardRecordService.getRecordsByBulletinId(bulletinHome3.id)}" />
					<p:panelGrid cellpadding="5"  style=" margin-bottom: 10px;width:100%">
						<p:row style="width:100%" styleClass="rowStyle">	
							<p:column>
								作废原因
							</p:column>
							<p:column>
								废除中介
							</p:column>
							<p:column rendered="#{bulletinHome3.instance.wayOfChoose != 'Random'}">
								顺延中介
							</p:column>
							<p:column>
								作废时间
							</p:column>
							<p:repeat var="_rec" value="#{discardRecords}" varStatus="_status">										
								<p:row style="width:100%">	
									<p:column>
										#{_rec.reason}
									</p:column>
									<p:column>
										#{_rec.formerSupplierName}
									</p:column>
									<p:column rendered="#{bulletinHome3.instance.wayOfChoose != 'Random'}">
										#{_rec.successSupplierName}
									</p:column>
									<p:column>
										<h:outputText value="#{_rec.createDate}" >
											<f:convertDateTime pattern="yyyy-MM-dd HH:mm:ss"/>
										</h:outputText>
									</p:column>
								</p:row>
							</p:repeat>
						</p:row>
					</p:panelGrid>
					
				</p:outputPanel>				
				<p:outputLabel
					value="相关附件"
				/>
			 	<p:outputPanel>
			 		<ui:include src="/WEB-INF/templates/include/bulletinAttachments.xhtml" />
			 	</p:outputPanel>
			</h:panelGrid>
			
			
			
			
		</div>
</ui:composition>